<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app" style="width: 100px;height: 100px;background-color:red" draggable="true" ondrop="drop_handler(event);"  ondragover="dragover_handler(event);">1</div>
    <div style="width: 100px;height: 100px;background-color:blue">1</div>
</body>
<script>
    //startSimulation 和 pauseSimulation 在其他地方定义
function handleVisibilityChange() {
  if (document.hidden) {
      alert(2)
      console.log(document.visibilityState)
  } else  {
      alert(4)
      console.log(document.visibilityState)
  }
}
function drop_handler(event) {
    console.log(event)
}

function dragover_handler(event) {
    console.log(event)
}

document.addEventListener("visibilitychange", handleVisibilityChange, false);
</script>
</html>